#include <stdio.h>
#include <math.h>

int main()
{
	int a, b, c, p, max = 0, counter=0, pmax=0;
	for (p=2; p<=1000; p+=2) {
	   counter = 0;
	   for (a=2; a<p/4+1; a++) {
		if ((p*(p-2*a))%(2*(p-a)) == 0)counter++;			
		
	   }
	   if (counter > max) {
		max = counter;
		pmax = p;
	   }	   
	}
	printf("%d\n", pmax);
}
